#@layout()
#define script()
<!--<script src="#(CPATH)/static/components/ckeditor/ckeditor.js"></script>-->
<script>
    // initEditor('editor1', 200);

    $('#form1').on('submit', function () {
        ajaxSubmit("#form1",
            function () {
                toastr.options.onHidden = function () {
                    location.href = "#(CPATH)/admin/article/comment?articleId=#(articleId)";
                }
                toastr.success('回复成功。');
            }
        );
        return false;
    });

</script>
#end

#define css()
<style>

    .post {
        margin: 20px 10px;
    }

    .comment-content {
        padding-bottom: 20px;
    }

    .comment-content p {
        display: inline;
    }

</style>
#end

#define content()
<div class="content-wrapper">

    <section class="content-header">
        <h1>
            #(articleTitle)
            <small>Comment Article</small>
        </h1>
    </section>

    <section class="content">

        <div class="row">
            <div class="col-xs-12">
                <div class="box box-primary">

                    <form class="form-horizontal form-setting" autocomplete="off"
                          id="form1"
                          method="post"
                          action="#(CPATH)/admin/article/doArticleComment">

                        <input type="hidden" name="articleId" value="#(articleId)">


                        <div class="box-body ">
                            <div class="post">
                                <div class="form-group">
                                    <label class="col-sm-1 control-label">虚拟用户</label>
                                    <div class="col-sm-2">
                                        <select class="form-control" name="userId">
                                            <option value="">请选择虚拟用户</option>
                                            #for(user : users)
                                            <option value="#(user.id ??)">
                                                #(user.nickname)
                                            </option>
                                            #end
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-1 control-label">评论内容</label>
                                    <div class="col-sm-8">
                                        <textarea name="content"
                                                  style="height: 200px;width: 100%;background-color: white"></textarea>
                                    </div>
                                </div>

                            </div>

                        </div>
                        <!-- /.box-body -->
                        <div class="box-footer">
                            <div class="col-sm-11 submit-block" style="padding-left: 78px">
                                <div class="box-submit">
                                    <button type="submit" class="btn btn-primary"> 评 论</button>
                                </div>
                            </div>
                        </div>
                        <!-- /.box-footer -->
                    </form>
                </div>
            </div>
        </div>

    </section>

</div>
#end
